﻿<%@ Page Language="C#" MasterPageFile="~/MasterPage.master" AutoEventWireup="true"
    CodeFile="Notice.aspx.cs" Inherits="Notice" Title="通知" Culture="auto" UICulture="auto" %>

<%@ Register Assembly="FredCK.FCKeditorV2" Namespace="FredCK.FCKeditorV2" TagPrefix="FCKeditorV2" %>
<%@ Register Assembly="AspNetPager" Namespace="Wuqi.Webdiyer" TagPrefix="webdiyer" %>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder" runat="Server">

    <script type="text/javascript">
    //上传公告附件文件。
    function InvokePopUploadParFile(id)
    {
        var url= 'uploadfile2.aspx?notice&pccid='+'<%=this.btnRefresh.ClientID%>'+'&id='+id ;
        window.open(url,'上传','height=340,width=600,resizable=yes');             
    } 
        
    function opencreatewindow(createtype)
    {
        if (window.showModalDialog)
        {      
            retVal = window.showModalDialog("createnotice.aspx?type=" + createtype ,'创建公告',"dialogHeight:500px;dialogWidth:860px;resizable:no;center:yes;");
        }
        else
        {
            retVal = window.open("createnotice.aspx?type=" + createtype ,'创建公告','height=480,width=860,resizable=yes,modal=yes');
        }  
        //window.location.href=window.location.pathname;
        window.location.reload();
    }
    </script>

    <h1 id="pagetitle" class="pagetitle">
        通知管理
        <asp:UpdateProgress ID="UpdateProgress1" runat="server">
            <ProgressTemplate>
                <div class="anistyle" id="ani">
                    正在加载数据，请耐心等待...
                </div>
            </ProgressTemplate>
        </asp:UpdateProgress>
    </h1>
    <asp:UpdatePanel ID="UpdatePanel" runat="server">
        <ContentTemplate>
            <div class="condition">
                <div class="conditionbutton">
                    <span id="span_create_all" runat="server">
                        <input type="submit" id="createall" onclick="javascript:opencreatewindow('all');"
                            value="创建公告" /></span> 
                            
                            <span id="span_create_one" runat="server">
                                <input type="submit" id="createone" onclick="javascript:opencreatewindow('one');"
                                    value="创建定向消息" /></span>
                </div>
                <asp:Button ID="btnRefresh" runat="server" Text="隐藏刷新" OnClick="btnRefresh_Click"
                    Style="display: none;" /></div>
            <div runat="server" id="divResult" class="divResult">
                <asp:Label ID="OperationResult" CssClass="result" runat="server" Text=""></asp:Label>
            </div>
            <div class="InfoArea">
                <div>
                    <asp:Panel ID="SummaryPanel" runat="server" Width="100%">
                        <asp:Repeater ID="Repeater" runat="server" OnItemCommand="Repeater_ItemCommand">
                            <HeaderTemplate>
                                <table width="100%" border="0" cellspacing="0" cellpadding="0">
                            </HeaderTemplate>
                            <ItemTemplate>
                                <tr style="height: 24px;">
                                    <td style="width: 130px;">
                                        <img src="images/bg_bullet_half_1.gif" alt="" />
                                        <span>
                                            <%#DataBinder.Eval(Container.DataItem, "Create_Time")%>
                                        </span>
                                    </td>
                                    <td style="width: 50px;">
                                        <%# DataBinder.Eval(Container.DataItem, "publish_type_name")%>
                                    </td>
                                    <td style="color: #757575;">
                                        <asp:LinkButton ID="btnDisplay" runat="server" CommandArgument='<%# DataBinder.Eval(Container.DataItem, "Notice_ID")%>'
                                            CommandName="detail" Text='<%# this.Substring(DataBinder.Eval(Container.DataItem, "Title").ToString()) %>'></asp:LinkButton>
                                    </td>
                                    <td align="right">
                                        <a onclick="javascript:opencreatewindow('edit&noticeid=<%#DataBinder.Eval(Container.DataItem, "Notice_ID")%>');return false;"
                                            href="#">[编辑信息]</a>
                                        <asp:LinkButton ID="GvDelete" runat="server" CommandArgument='<%#DataBinder.Eval(Container.DataItem, "Notice_ID")%>'
                                            CommandName="delete" OnClientClick="javascript:return confirm('您确定要删除此条记录吗？');">[删除信息]</asp:LinkButton>
                                    </td>
                                </tr>
                            </ItemTemplate>
                            <FooterTemplate>
                                </table>
                            </FooterTemplate>
                        </asp:Repeater>
                        <webdiyer:AspNetPager ID="AspNetPager" runat="server" ShowCustomInfoSection="Left"
                            CustomInfoHTML="总计篇数：%RecordCount%，总页数：%PageCount%，当前为第%CurrentPageIndex%篇" CustomInfoTextAlign="left"
                            CustomInfoStyle="padding-top:8px;font-weight:bold;" HorizontalAlign="right" FirstPageText="首篇"
                            LastPageText="最后" NextPageText="下一篇" OnPageChanged="AspNetPager_PageChanged"
                            PrevPageText="上一篇" ShowPageIndexBox="Always" SubmitButtonText="Go" TextAfterPageIndexBox="篇"
                            TextBeforePageIndexBox="转到" CssClass="anpager" CurrentPageButtonClass="cpb">
                        </webdiyer:AspNetPager>
                    </asp:Panel>
                    <asp:Panel ID="DetailPanel" runat="server" Width="100%" Visible="false">
                        <table width="100%" border="0" cellspacing="0" cellpadding="0" style="border: solid 1px #bababa;
                            margin-bottom: 4px;">
                            <tr style="height: 20px; background-color: #f7f7f7;">
                                <td style="width: 10%;">
                                    消息编号：</td>
                                <td style="width: 40%; color: Red; font-weight: bold;">
                                    <asp:Label runat="server" ID="labNotice_ID"></asp:Label>
                                </td>
                                <td style="width: 10%;">
                                    发布人：</td>
                                <td style="width: 40%;">
                                    <asp:Label runat="server" ID="labDisplay_Name"></asp:Label>
                                </td>
                            </tr>
                            <tr style="height: 20px; background-color: #f7f7f7;">
                                <td>
                                    消息类型：</td>
                                <td>
                                    <asp:Label runat="server" ID="labPublish_Type_Name"></asp:Label>
                                </td>
                                <td>
                                    发布时间：</td>
                                <td>
                                    <asp:Label runat="server" ID="labCreate_Time"></asp:Label>
                                </td>
                            </tr>
                            <tr style="height: 20px; background-color: #f7f7f7;">
                                <td>
                                    消息标题：</td>
                                <td colspan="3">
                                    <asp:Label runat="server" ID="labTitle"></asp:Label>
                                </td>
                            </tr>
                            <tr style="height: 20px; background-color: #f7f7f7;">
                                <td>
                                    消息内容：</td>
                                <td>
                                    &nbsp;</td>
                                <td>
                                    &nbsp;</td>
                                <td align="right" style="padding-right: 4px; font-weight: bold;">
                                </td>
                            </tr>
                            <tr>
                                <td style="height: 1px; background-color: #F0f0f0;" colspan="4">
                                </td>
                            </tr>
                            <tr style="height: 20px;" valign="top">
                                <td height="300" colspan="4" style="font-weight: bold; color: black; padding-top: 4px;">
                                    <iframe runat="server" id="noticeframe" scrolling="yes" height="300px" frameborder="no"
                                        width="100%"></iframe>
                                </td>
                            </tr>
                            <tr>
                                <td style="height: 1px; background-color: #F0f0f0;" colspan="4">
                                </td>
                            </tr>
                            <tr style="height: 20px;">
                                <td>
                                    附件：</td>
                                <td colspan="3" align="right">
                                    <asp:Literal ID="labAttachFile" runat="server"></asp:Literal>
                                </td>
                            </tr>
                            <tr>
                                <td style="height: 1px; background-color: #F0f0f0;" colspan="4">
                                </td>
                            </tr>
                            <tr style="height: 20px;">
                                <td colspan="4">
                                    <asp:Repeater ID="RepFile" runat="server" OnItemCommand="RepFile_ItemCommand">
                                        <ItemTemplate>
                                            <li><a href="getfile.aspx?fileid=<%#DataBinder.Eval(Container.DataItem, "File_ID")%>">
                                                <%#DataBinder.Eval(Container.DataItem, "File_Name")%>
                                            </a>
                                                <asp:LinkButton ID="btnDeleteFile" CommandName='<%#DataBinder.Eval(Container.DataItem, "File_ID")%>'
                                                    Width="100px" runat="server">删除</asp:LinkButton>
                                            </li>
                                        </ItemTemplate>
                                    </asp:Repeater>
                                </td>
                            </tr>
                            <tr style="height: 24px;">
                                <td colspan="4" align="right">
                                    <asp:Button ID="btnDetailReturn" runat="server" Text="返回" OnClick="btnDetailReturn_Click" /></td>
                            </tr>
                            <tr>
                                <td style="height: 1px; background-color: #F0f0f0;" colspan="4">
                                </td>
                            </tr>
                        </table>
                    </asp:Panel>
                </div>
            </div>
        </ContentTemplate>
    </asp:UpdatePanel>
</asp:Content>
